package com.tcs.model.email;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Properties;

/**
 * Email Bean
 *  
 * @author wangBo
 */
public class MailSenderInfo implements Serializable {

	private static final long serialVersionUID = 1L;

	// 发送邮件的服务器的IP和端口
	private String mailServerHost;
	private String mailServerPort = "25";
	// 邮件发送者的地址
	private String fromAddress;
	// 邮件接收者的地址
	private String toAddress;
	// 登陆邮件发送服务器的用户名和密码
	private String userName;
	private String password;
	// 是否需要身份验证
	private boolean validate = false;
	// 邮件主题
	private String subject;
	// 邮件的文本内容
	private String content;
	// 邮件附件的文件名
	private String[] attachFileNames;
	// 抄送
	private String[] ccs;
	
	// 发送方式 1 : text , 2 : html
	private Integer sendFlag = 1;
	
	public MailSenderInfo() {
		super();
	}
	
	public MailSenderInfo(String content) {
		super();
		this.content = content;
	}

	public MailSenderInfo(String mailServerHost, String mailServerPort, String fromAddress, String toAddress,
			String userName, String password, boolean validate, String subject, String content,
			String[] attachFileNames, String[] ccs) {
		super();
		this.mailServerHost = mailServerHost;
		this.mailServerPort = mailServerPort;
		this.fromAddress = fromAddress;
		this.toAddress = toAddress;
		this.userName = userName;
		this.password = password;
		this.validate = validate;
		this.subject = subject;
		this.content = content;
		this.attachFileNames = attachFileNames;
		this.ccs = ccs;
	}

	/**
	 * 获得邮件会话属性
	 */
//	public Properties getProperties() {
//		properties = new Properties();
//		properties.put("mail.smtp.host", this.mailServerHost);
//		properties.put("mail.smtp.port", this.mailServerPort);
//		properties.put("mail.smtp.auth", validate ? "true" : "false");
//		return properties;
//	}
	
	public String getMailServerHost() {
		return mailServerHost;
	}

	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}

	public String getMailServerPort() {
		return mailServerPort;
	}

	public void setMailServerPort(String mailServerPort) {
		this.mailServerPort = mailServerPort;
	}

	public String getFromAddress() {
		return fromAddress;
	}

	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public String getToAddress() {
		return toAddress;
	}

	public void setToAddress(String toAddress) {
		this.toAddress = toAddress;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public boolean isValidate() {
		return validate;
	}

	public void setValidate(boolean validate) {
		this.validate = validate;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String[] getAttachFileNames() {
		return attachFileNames;
	}

	public void setAttachFileNames(String[] attachFileNames) {
		this.attachFileNames = attachFileNames;
	}

	public String[] getCcs() {
		return ccs;
	}

	public void setCcs(String[] ccs) {
		this.ccs = ccs;
	}

	public Integer getSendFlag() {
		return sendFlag;
	}

	public void setSendFlag(Integer sendFlag) {
		this.sendFlag = sendFlag;
	}

	@Override
	public String toString() {
		return "MailSenderInfo [mailServerHost=" + mailServerHost + ", mailServerPort=" + mailServerPort
				+ ", fromAddress=" + fromAddress + ", toAddress=" + toAddress + ", userName=" + userName + ", password="
				+ password + ", validate=" + validate + ", subject=" + subject + ", content=" + content
				+ ", attachFileNames=" + Arrays.toString(attachFileNames) + ", ccs=" + Arrays.toString(ccs)
				+ ", sendFlag=" + sendFlag + "]";
	}
}